package com.atguigu.dao;

import com.atguigu.bean.TaskTagRule;
import com.atguigu.util.MySQLUtil;

import java.util.List;

public class TaskTagRuleDAO {
    public static List<TaskTagRule> getTaskTagRule(String taskId){

        String sql = "select " +
                "ttr.id," +
                "ttr.tag_id," +
                "ttr.task_id," +
                "ttr.query_value," +
                "ttr.sub_tag_id," +
                "ti.tag_name as sub_tag_value" +
                " from task_tag_rule ttr " +
                " join tag_info ti" +
                " on ttr.sub_tag_id=ti.id" +
                " where task_id='"+taskId+"'";

        List<TaskTagRule> taskTagRules = MySQLUtil.queryList(sql, TaskTagRule.class, true);


        return taskTagRules;
    }
}
